package billings.classtasks.tasks;

public class Task {

	private int id;
	private String title;
	private String description;
	private String dueDate;
	
	private int classId;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDueDate() {
		return dueDate;
	}

	public void setDueDate(String dueDate) {
		this.dueDate = dueDate;
	}

	public int getClassId() {
		return classId;
	}

	public void setClassId(int classId) {
		this.classId = classId;
	}
	
	@Override
	public String toString(){
		return title + " - " + description;
	}
	
	public String toStringTruncate(){
		if((title+" - "+description).length() <= 25){
			return title + " - " + description;
		}else{
			return (title + " - " + description).substring(0, 25) + "...";
		}
	}
}
